<ng-container *ngIf="selection">
  <nav ngbNav
       #nav="ngbNav"
       class="nav-tabs"
       cdStatefulTab="host-details">
    <ng-container ngbNavItem="devices">
      <a ngbNavLink
         i18n>Devices</a>
      <ng-template ngbNavContent>
        <cd-device-list [hostname]="selection['hostname']"></cd-device-list>
      </ng-template>
    </ng-container>
    <ng-container ngbNavItem="inventory"
                  *ngIf="permissions.hosts.read">
      <a ngbNavLink
         i18n>Physical Disks</a>
      <ng-template ngbNavContent>
        <cd-inventory [hostname]="selectedHostname"></cd-inventory>
      </ng-template>
    </ng-container>
    <ng-container ngbNavItem="daemons"
                  *ngIf="permissions.hosts.read">
      <a ngbNavLink
         i18n>Daemons</a>
      <ng-template ngbNavContent>
        <cd-service-daemon-list [hostname]="selectedHostname"
                                flag="hostDetails"
                                [hiddenColumns]="['hostname']">
        </cd-service-daemon-list>
      </ng-template>
    </ng-container>
    <ng-container ngbNavItem="performance-details"
                  *ngIf="permissions.grafana.read">
      <a ngbNavLink
         i18n>Performance Details</a>
      <ng-template ngbNavContent>
        <cd-grafana i18n-title
                    title="Host details"
                    [grafanaPath]="'host-details?var-ceph_hosts=' + selectedHostname"
                    [type]="'metrics'"
                    uid="rtOg0AiWz"
                    grafanaStyle="four">
        </cd-grafana>
      </ng-template>
    </ng-container>
    <ng-container ngbNavItem="device-health">
      <a ngbNavLink
         i18n>Device health</a>
      <ng-template ngbNavContent>
        <cd-smart-list *ngIf="selectedHostname; else noHostname"
                       [hostname]="selectedHostname"></cd-smart-list>
      </ng-template>
    </ng-container>
  </nav>

  <div [ngbNavOutlet]="nav"></div>
</ng-container>

<ng-template #noHostname>
  <cd-alert-panel type="error"
                  i18n>No hostname found.</cd-alert-panel>
</ng-template>
